package com.bw.lib_storage.db.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.bw.lib_storage.db.entity.VideoStarEntity

@Dao
interface VideoStarDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(videoStar: VideoStarEntity)

    @Delete
    fun deleteVideoStar(videoStar: VideoStarEntity)

    // 查询是否已收藏（根据视频ID）
    @Query("SELECT * FROM star WHERE id = :id")
    fun getFavoriteByVideoId(id:String):VideoStarEntity?

    @Query("SELECT * FROM star")
    fun getAllFavorites():List<VideoStarEntity>
}